#! /usr/bin/python

MAX = 10*10
f = open("triangles.txt", "r")

triangles = []
for i in range(1000):
    s = str(f.readline())
    l = [int(x) for x in s.split(',')]
    triangles.append(l)
f.close()

def isIn(tr):
    (x0, y0) = (tr[0], tr[1])
    (x1, y1) = (tr[2], tr[3])
    (x2, y2) = (tr[4], tr[5])
    if x0 > 0 and y0 > 0 and x1 > 0 and y1 > 0 and x2 > 0 and y2 > 0: return 0
    if x0 > 0 and y0 < 0 and x1 > 0 and y1 < 0 and x2 > 0 and y2 < 0: return 0
    if x0 < 0 and y0 > 0 and x1 < 0 and y1 > 0 and x2 < 0 and y2 > 0: return 0
    if x0 < 0 and y0 < 0 and x1 < 0 and y1 < 0 and x2 < 0 and y2 < 0: return 0

    if x0 == x1: 
	c01 = x0
	k01 = MAX
    else: 
	c01 = (y1*x0-y0*x1)/float(x0-x1)
	k01 = (y0 - y1)/float(x0 - x1)    
    
    if y2 < x2*k01+c01 and 0 > c01: return 0
    if y2 > x2*k01+c01 and 0 < c01: return 0
    
    if x0 == x2: 
	c02 = x0
	k02 = MAX
    else: 
	c02 = (y2*x0-y0*x2)/float(x0-x2)
	k02 = (y0 - y2)/float(x0 - x2)

    if y1 < x1*k02+c02 and c02 < 0: return 0
    if y1 > x1*k02+c02 and c02 > 0: return 0

    if x1 == x2: 
	c12 = x1
	k12 = MAX
    else: 
	c12 = (y1*x2-y2*x1)/float(x2-x1)
	k12 = (y1 - y2)/float(x1 - x2)
    if y0 < x0*k12+c12 and c12 < 0: return 0
    if y0 > x0*k12+c12 and c12 > 0: return 0

    return 1
  
count = 0
for tr in triangles:
    count += isIn(tr)

print count 


